/* Resource Library - Optimized for 16:9 Pad 1920x1080 - 3 Cards Layout */
.resource-library {
  padding: 1.5rem 3rem;
  max-width: 100%;
  margin: 0;
  min-height: 100vh;
}

.library-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #334155;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.header-title h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
  line-height: 1.2;
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9375rem;
  color: #94a3b8;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.stat-number {
  font-weight: 600;
  color: #667eea;
  font-size: 1rem;
}

.stat-label {
  color: #94a3b8;
}

.stat-divider {
  color: #64748b;
}

.header-description {
  color: #94a3b8;
  margin: 0;
  font-size: 1rem;
}

.import-btn {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 1.75rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-decoration: none;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.import-btn svg {
  width: 20px;
  height: 20px;
}

.import-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.library-controls {
  margin-bottom: 1.5rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 1rem;
  padding: 1.5rem;
}

.controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  gap: 1.5rem;
}

.search-section {
  flex: 1;
  max-width: 600px;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-box svg {
  position: absolute;
  left: 1.125rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  width: 20px;
  height: 20px;
}

.search-box input {
  width: 100%;
  padding: 0.875rem 3.5rem 0.875rem 3.25rem;
  background: #0f172a;
  border: 2px solid #334155;
  border-radius: 0.75rem;
  color: #f8fafc;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.search-box input::placeholder {
  color: #64748b;
}

.search-box input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.clear-search {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.375rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clear-search:hover {
  color: #f8fafc;
  background: #334155;
}

.view-controls {
  display: flex;
  align-items: center;
}

.filter-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #334155;
}

.category-filter {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.filter-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
}

.category-buttons {
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
}

.category-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  background: #0f172a;
  border: 2px solid #334155;
  border-radius: 0.625rem;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9375rem;
  font-weight: 500;
}

.category-btn svg {
  width: 18px;
  height: 18px;
}

.category-btn:hover {
  background: #334155;
  color: #f8fafc;
  border-color: #475569;
  transform: translateY(-1px);
}

.category-btn.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.sort-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.sort-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.sort-select {
  padding: 0.625rem 1.125rem;
  background: #0f172a;
  border: 2px solid #334155;
  border-radius: 0.625rem;
  color: #f8fafc;
  cursor: pointer;
  font-size: 0.9375rem;
  min-width: 140px;
  transition: all 0.2s ease;
}

.sort-select:hover {
  border-color: #475569;
}

.sort-select:focus {
  outline: none;
  border-color: #667eea;
}

.view-toggle {
  display: flex;
  gap: 0.375rem;
}

.view-btn {
  padding: 0.625rem;
  background: #0f172a;
  border: 2px solid #334155;
  border-radius: 0.625rem;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-btn svg {
  width: 20px;
  height: 20px;
}

.view-btn:hover {
  background: #334155;
  color: #f8fafc;
}

.view-btn.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.resources-container {
  min-height: 400px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  color: #94a3b8;
}

.empty-state svg {
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem 0;
  color: #f8fafc;
}

.empty-state p {
  margin: 0 0 2rem 0;
}

.resources-grid {
  display: grid;
  gap: 1.5rem;
}

.resources-grid.grid {
  grid-template-columns: repeat(3, 1fr);
  max-width: 1800px;
  margin: 0 auto;
}

.resources-grid.list {
  grid-template-columns: 1fr;
}

.resource-card {
  background: #1e293b;
  border: 2px solid #334155;
  border-radius: 1.25rem;
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  aspect-ratio: 16 / 9;
}

.resource-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  border-color: #667eea;
  text-decoration: none;
  color: inherit;
}

.resource-thumbnail {
  position: relative;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.resource-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.resource-card:hover .resource-thumbnail img {
  transform: scale(1.05);
}

.resource-type {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 0.625rem 1rem;
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

.resource-type svg {
  width: 18px;
  height: 18px;
}

.resource-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.resource-card:hover .resource-overlay {
  opacity: 1;
}

.overlay-actions {
  display: flex;
  gap: 1rem;
}

.overlay-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  position: relative;
  z-index: 10;
}

.overlay-btn svg {
  width: 24px;
  height: 24px;
}

.overlay-btn:hover {
  background: white;
  transform: scale(1.1);
}

.resource-info {
  padding: 1rem 1.25rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.75), transparent);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  pointer-events: none;
}

.resource-title {
  font-size: 1.375rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 0.625rem 0;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}



.resource-stats {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  font-size: 1rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.stat-item svg {
  color: rgba(255, 255, 255, 0.95);
  width: 18px;
  height: 18px;
}





/* Responsive design */
@media (max-width: 1024px) {
  .resources-grid.grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .resource-library {
    padding: 1rem;
  }
  
  .library-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .header-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .library-controls {
    padding: 1rem;
  }

  .controls-row {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .search-section {
    max-width: none;
  }
  
  .filter-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .category-filter {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .category-buttons {
    width: 100%;
    justify-content: flex-start;
  }

  .sort-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .resources-grid.grid {
    grid-template-columns: 1fr;
  }

  .resource-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .resource-format {
    margin-left: 0;
    align-self: flex-start;
  }
}

/* Optimizations for 16:9 Pad Layout - 3 Cards Per Row */
@media (min-width: 1280px) {
  .resources-grid.grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1279px) {
  .resources-grid.grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .resources-grid.grid {
    grid-template-columns: 1fr;
  }
}
